package com.itheima_01.day07;

public class Student {
    private String name;
    private int age;



    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setAge(int age) {
        if (age >= 0 && age <= 120) {
            this.age = age;
        } else {
            System.out.println("年龄不合法！");
        }

    }

    public int getAge() {
        return age;
    }

    public void show() {
        System.out.println(name + "...." + age);
    }
    public Student() {
        System.out.println("Student的构造方法");
    }
}
